home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 May (DVD) / Macworld Resource DVD May 2003.toast / Data / Software / Bonus / Database / mysql-max-3.23.55.sit / mysql-max-3.23.55-apple-darwi.1 / INSTALL-BINARY < prev    next >
Encoding:
Text File  |  2003-01-22  |  6.7 KB  |  168 lines  |  [TEXT/ttxt]

  1. Installing a MySQL Binary Distribution
  2. --------------------------------------
  3.  
  4. See also *Note Windows binary installation::, *Note Linux-RPM::, and
  5. *Note Building clients::.
  6.  
  7. You need the following tools to install a MySQL binary distribution:
  8.  
  9.    * GNU `gunzip' to uncompress the distribution.
  10.  
  11.    * A reasonable `tar' to unpack the distribution. GNU `tar' is known
  12.      to work.  Sun `tar' is known to have problems.
  13.  
  14. An alternative installation method under Linux is to use RPM-based (RPM
  15. Package Manager) distributions.  *Note Linux-RPM::.
  16.  
  17. If you run into problems, *please always use `mysqlbug'* when posting
  18. questions to <mysql@lists.mysql.com>.  Even if the problem isn't a bug,
  19. `mysqlbug' gathers system information that will help others solve your
  20. problem.  By not using `mysqlbug', you lessen the likelihood of getting
  21. a solution to your problem!  You will find `mysqlbug' in the `bin'
  22. directory after you unpack the distribution.  *Note Bug reports::.
  23.  
  24. The basic commands you must execute to install and use a MySQL binary
  25. distribution are:
  26.  
  27.      shell> groupadd mysql
  28.      shell> useradd -g mysql mysql
  29.      shell> cd /usr/local
  30.      shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
  31.      shell> ln -s full-path-to-mysql-VERSION-OS mysql
  32.      shell> cd mysql
  33.      shell> scripts/mysql_install_db
  34.      shell> chown -R root  .
  35.      shell> chown -R mysql data
  36.      shell> chgrp -R mysql .
  37.      shell> bin/safe_mysqld --user=mysql &
  38.      or
  39.      shell> bin/mysqld_safe --user=mysql &
  40.      if you are running MySQL 4.x
  41.  
  42. You can add new users using the `bin/mysql_setpermission' script if you
  43. install the `DBI' and `Msql-Mysql-modules' Perl modules.
  44.  
  45. A more detailed description follows.
  46.  
  47. To install a binary distribution, follow these steps, then proceed to
  48. *Note Post-installation::, for post-installation setup and testing:
  49.  
  50.   1. Pick the directory under which you want to unpack the
  51.      distribution, and move into it.  In the following example, we
  52.      unpack the distribution under `/usr/local' and create a directory
  53.      `/usr/local/mysql' into which MySQL is installed.  (The following
  54.      instructions, therefore, assume you have permission to create
  55.      files in `/usr/local'.  If that directory is protected, you will
  56.      need to perform the installation as `root'.)
  57.  
  58.   2. Obtain a distribution file from one of the sites listed in *Note
  59.      Getting MySQL: Getting MySQL.
  60.  
  61.      MySQL binary distributions are provided as compressed `tar'
  62.      archives and have names like `mysql-VERSION-OS.tar.gz', where
  63.      `VERSION' is a number (for example, `3.21.15'), and `OS' indicates
  64.      the type of operating system for which the distribution is intended
  65.      (for example, `pc-linux-gnu-i586').
  66.  
  67.   3. If you see a binary distribution marked with the `-max' suffix,
  68.      this means that the binary has support for transaction-safe tables
  69.      and other features. *Note `mysqld-max': mysqld-max.  Note that all
  70.      binaries are built from the same MySQL source distribution.
  71.  
  72.   4. Add a user and group for `mysqld' to run as:
  73.  
  74.           shell> groupadd mysql
  75.           shell> useradd -g mysql mysql
  76.  
  77.      These commands add the `mysql' group and the `mysql' user.  The
  78.      syntax for `useradd' and `groupadd' may differ slightly on
  79.      different versions of Unix.  They may also be called `adduser' and
  80.      `addgroup'.  You may wish to call the user and group something
  81.      else instead of `mysql'.
  82.  
  83.   5. Change into the intended installation directory:
  84.  
  85.           shell> cd /usr/local
  86.  
  87.   6. Unpack the distribution and create the installation directory:
  88.  
  89.           shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
  90.           shell> ln -s full-path-to-mysql-VERSION-OS mysql
  91.  
  92.      The first command creates a directory named `mysql-VERSION-OS'.
  93.      The second command makes a symbolic link to that directory.  This
  94.      lets you refer more easily to the installation directory as
  95.      `/usr/local/mysql'.
  96.  
  97.   7. Change into the installation directory:
  98.  
  99.           shell> cd mysql
  100.  
  101.      You will find several files and subdirectories in the `mysql'
  102.      directory.  The most important for installation purposes are the
  103.      `bin' and `scripts' subdirectories.
  104.  
  105.     `bin'
  106.           This directory contains client programs and the server You
  107.           should add the full pathname of this directory to your `PATH'
  108.           environment variable so that your shell finds the MySQL
  109.           programs properly. *Note Environment variables::.
  110.  
  111.     `scripts'
  112.           This directory contains the `mysql_install_db' script used to
  113.           initialise the `mysql' database containing the grant tables
  114.           that store the server access permissions.
  115.  
  116.   8. If you would like to use `mysqlaccess' and have the MySQL
  117.      distribution in some non-standard place, you must change the
  118.      location where `mysqlaccess' expects to find the `mysql' client.
  119.      Edit the `bin/mysqlaccess' script at approximately line 18.
  120.      Search for a line that looks like this:
  121.  
  122.           $MYSQL     = '/usr/local/bin/mysql';    # path to mysql executable
  123.  
  124.      Change the path to reflect the location where `mysql' actually is
  125.      stored on your system.  If you do not do this, you will get a
  126.      `Broken pipe' error when you run `mysqlaccess'.
  127.  
  128.   9. Create the MySQL grant tables (necessary only if you haven't
  129.      installed MySQL before):
  130.           shell> scripts/mysql_install_db
  131.  
  132.      Note that MySQL versions older than Version 3.22.10 started the
  133.      MySQL server when you run `mysql_install_db'.  This is no longer
  134.      true!
  135.  
  136.  10. Change ownership of binaries to `root' and ownership of the data
  137.      directory to the user that you will run `mysqld' as:
  138.  
  139.           shell> chown -R root  /usr/local/mysql/.
  140.           shell> chown -R mysql /usr/local/mysql/data
  141.           shell> chgrp -R mysql /usr/local/mysql/.
  142.  
  143.      The first command changes the `owner' attribute of the files to the
  144.      `root' user, the second one changes the `owner' attribute of the
  145.      data directory to the `mysql' user, and the third one changes the
  146.      `group' attribute to the `mysql' group.
  147.  
  148.  11. If you want to install support for the Perl `DBI'/`DBD' interface,
  149.      see *Note Perl support::.
  150.  
  151.  12. If you would like MySQL to start automatically when you boot your
  152.      machine, you can copy `support-files/mysql.server' to the location
  153.      where your system has its startup files.  More information can be
  154.      found in the `support-files/mysql.server' script itself and in
  155.      *Note Automatic start::.
  156.  
  157.  
  158. After everything has been unpacked and installed, you should initialise
  159. and test your distribution.
  160.  
  161. You can start the MySQL server with the following command:
  162.  
  163.      shell> bin/safe_mysqld --user=mysql &
  164.  
  165. Now proceed to *Note `safe_mysqld': safe_mysqld, and *Note
  166. Post-installation::.
  167.  
  168.